﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

/// <summary>
/// 产品入库基础输入参数
/// </summary>
public class WarehousingBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 入库编号
    /// </summary>
    public virtual string? WarehousingNumber { get; set; }
    
    /// <summary>
    /// 所属库位
    /// </summary>
    [Required(ErrorMessage = "所属库位不能为空")]
    public virtual long? StorageLocationId { get; set; }
    
    /// <summary>
    /// 所属库区
    /// </summary>
    [Required(ErrorMessage = "所属库区不能为空")]
    public virtual long? ReservoirId { get; set; }
    
    /// <summary>
    /// 所属仓库
    /// </summary>
    [Required(ErrorMessage = "所属仓库不能为空")]
    public virtual long? WarehouseId { get; set; }
    
    /// <summary>
    /// 是否启用
    /// </summary>
    [Required(ErrorMessage = "是否启用不能为空")]
    public virtual bool? IsEnable { get; set; }
    
}

/// <summary>
/// 产品入库分页查询输入参数
/// </summary>
public class PageWarehousingInput : BasePageInput
{
    /// <summary>
    /// 入库编号
    /// </summary>
    public string? WarehousingNumber { get; set; }
    
    /// <summary>
    /// 所属库位
    /// </summary>
    public long? StorageLocationId { get; set; }
    
    /// <summary>
    /// 所属库区
    /// </summary>
    public long? ReservoirId { get; set; }
    
    /// <summary>
    /// 所属仓库
    /// </summary>
    public long? WarehouseId { get; set; }
    
    /// <summary>
    /// 是否启用
    /// </summary>
    public bool? IsEnable { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 产品入库增加输入参数
/// </summary>
public class AddWarehousingInput
{
    /// <summary>
    /// 入库编号
    /// </summary>
    [MaxLength(32, ErrorMessage = "入库编号字符长度不能超过32")]
    public string? WarehousingNumber { get; set; }
    
    /// <summary>
    /// 所属库位
    /// </summary>
    [Required(ErrorMessage = "所属库位不能为空")]
    public long? StorageLocationId { get; set; }
    
    /// <summary>
    /// 所属库区
    /// </summary>
    [Required(ErrorMessage = "所属库区不能为空")]
    public long? ReservoirId { get; set; }
    
    /// <summary>
    /// 所属仓库
    /// </summary>
    [Required(ErrorMessage = "所属仓库不能为空")]
    public long? WarehouseId { get; set; }
    
    /// <summary>
    /// 是否启用
    /// </summary>
    [Required(ErrorMessage = "是否启用不能为空")]
    public bool? IsEnable { get; set; }
    
}

/// <summary>
/// 产品入库删除输入参数
/// </summary>
public class DeleteWarehousingInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 产品入库更新输入参数
/// </summary>
public class UpdateWarehousingInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 入库编号
    /// </summary>    
    [MaxLength(32, ErrorMessage = "入库编号字符长度不能超过32")]
    public string? WarehousingNumber { get; set; }
    
    /// <summary>
    /// 所属库位
    /// </summary>    
    [Required(ErrorMessage = "所属库位不能为空")]
    public long? StorageLocationId { get; set; }
    
    /// <summary>
    /// 所属库区
    /// </summary>    
    [Required(ErrorMessage = "所属库区不能为空")]
    public long? ReservoirId { get; set; }
    
    /// <summary>
    /// 所属仓库
    /// </summary>    
    [Required(ErrorMessage = "所属仓库不能为空")]
    public long? WarehouseId { get; set; }
    
    /// <summary>
    /// 是否启用
    /// </summary>    
    [Required(ErrorMessage = "是否启用不能为空")]
    public bool? IsEnable { get; set; }
    
}

/// <summary>
/// 产品入库主键查询输入参数
/// </summary>
public class QueryByIdWarehousingInput : DeleteWarehousingInput
{
}

/// <summary>
/// 下拉数据输入参数
/// </summary>
public class DropdownDataWarehousingInput
{
    /// <summary>
    /// 是否用于分页查询
    /// </summary>
    public bool FromPage { get; set; }
}

/// <summary>
/// 产品入库数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportWarehousingInput : BaseImportInput
{
    /// <summary>
    /// 入库编号
    /// </summary>
    [ImporterHeader(Name = "入库编号")]
    [ExporterHeader("入库编号", Format = "", Width = 25, IsBold = true)]
    public string? WarehousingNumber { get; set; }
    
    /// <summary>
    /// 所属库位 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? StorageLocationId { get; set; }
    
    /// <summary>
    /// 所属库位 文本
    /// </summary>
    [ImporterHeader(Name = "*所属库位")]
    [ExporterHeader("*所属库位", Format = "", Width = 25, IsBold = true)]
    public string StorageLocationFkDisplayName { get; set; }
    
    /// <summary>
    /// 所属库区 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? ReservoirId { get; set; }
    
    /// <summary>
    /// 所属库区 文本
    /// </summary>
    [ImporterHeader(Name = "*所属库区")]
    [ExporterHeader("*所属库区", Format = "", Width = 25, IsBold = true)]
    public string ReservoirFkDisplayName { get; set; }
    
    /// <summary>
    /// 所属仓库 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? WarehouseId { get; set; }
    
    /// <summary>
    /// 所属仓库 文本
    /// </summary>
    [ImporterHeader(Name = "*所属仓库")]
    [ExporterHeader("*所属仓库", Format = "", Width = 25, IsBold = true)]
    public string WarehouseFkDisplayName { get; set; }
    
    /// <summary>
    /// 是否启用
    /// </summary>
    [ImporterHeader(Name = "*是否启用")]
    [ExporterHeader("*是否启用", Format = "", Width = 25, IsBold = true)]
    public bool? IsEnable { get; set; }
    
}
